/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.xd.manager.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.xd.domain.bo.DocumentFlowHandleBO;
import com.xy.biz.xd.domain.query.DocumentFlowHandleQuery;
import com.xy.biz.xd.domain.converter.DocumentFlowHandleConverter;
import com.xy.biz.xd.manager.DocumentFlowHandleManager;
import com.xy.biz.xd.dao.DocumentFlowHandleDao;

/**
 *
 *
 * @author wwj
 * @date 2021-2-4
 */
@Service
public class DocumentFlowHandleManagerImpl implements DocumentFlowHandleManager {

	@Autowired
	private DocumentFlowHandleDao documentFlowHandleDao;

	@Override
	public int saveAllDocumentFlowHandle(Collection<DocumentFlowHandleBO> collection) {
		return documentFlowHandleDao.saveAllDocumentFlowHandle(DocumentFlowHandleConverter.toPO(collection));
	}

	@Override
	public int updateDocumentFlowHandle(DocumentFlowHandleBO documentFlowHandleBO) {
		return documentFlowHandleDao.updateDocumentFlowHandle(DocumentFlowHandleConverter.toPO(documentFlowHandleBO));
	}

	@Override
	public int deleteDocumentFlowHandle(Long documentFlowHandleId) {
		return documentFlowHandleDao.deleteDocumentFlowHandle(documentFlowHandleId);
	}

	@Override
	public DocumentFlowHandleBO getDocumentFlowHandle(Long documentFlowHandleId) {
		return DocumentFlowHandleConverter.fromPO(documentFlowHandleDao.getDocumentFlowHandle(documentFlowHandleId));
	}

	@Override
	public List<DocumentFlowHandleBO> listDocumentFlowHandleById(Collection<Long> collection) {
		return DocumentFlowHandleConverter.fromPO(documentFlowHandleDao.listDocumentFlowHandleById(collection));
	}

	@Override
	public List<DocumentFlowHandleBO> listDocumentFlowHandle(DocumentFlowHandleQuery query) {
		return DocumentFlowHandleConverter.fromPO(documentFlowHandleDao.listDocumentFlowHandle(query));
	}

	@Override
	public int countDocumentFlowHandle(DocumentFlowHandleQuery query) {
		return documentFlowHandleDao.countDocumentFlowHandle(query);
	}

	@Override
	public DocumentFlowHandleBO getLastPhaseHandle(DocumentFlowHandleQuery query) {
		return DocumentFlowHandleConverter.fromPO(documentFlowHandleDao.getLastPhaseHandle(query));
	}

}
